package fit.deni.pages;

import java.util.Collection;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.hibernate.Hibernate;

import fit.deni.beans.DVD;
import fit.deni.beans.Glumac;
import fit.deni.beans.Zanr;

public class Movie {
	
	@Persist
	private DVD dvdObject;
	
//	@Persist
//	@Property
//	private Collection<Reditelj> reditelji;
	@Persist
	@Property
	private Collection<Glumac> glumci;
	@Persist
	@Property
	private Collection<Zanr> zanrovi;

	public DVD getDvdObject() {
		return dvdObject;
	}

	public void setDvdObject(DVD dvdObject) {
		this.dvdObject = dvdObject;
//		reditelji = dvdObject.getReditelji();
		glumci = dvdObject.getGlumci();
		zanrovi = dvdObject.getZanrovi();
//		Hibernate.initialize(reditelji);
		Hibernate.initialize(glumci);
		Hibernate.initialize(zanrovi);
	}
	
	

}
